package com.linzelin.advice;


import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;


/**
 * @author 君未洋
 */
@ControllerAdvice
public class HandlerControllerException {

    @ExceptionHandler(AccessDeniedException.class)
    public String handlerException() {
        //出现对应的异常就进入403界面
        //后面那个500的触发不了不知道为什么
        return "403";
    }

    @ExceptionHandler(RuntimeException.class)
    public String runtimeHandlerException() {
        return "500";
    }

}
